home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
T-TPUG Old Monthly Disks
/
(c)tf.d64
/
screen 40.3.pal
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
16KB
|
635 lines
5 OPEN15,8,15,"I0":OPEN2,8,2,"0:SCREEN 40.3.ML.D,P,W"
10 SYS700
1000 .OPT P,O2
1010 *=$C000
1020 ;*********************************
1030 ; *
1040 ; SCREEN 40.3.M/L *
1050 ; *
1060 ; BY *
1070 ; *
1080 ; BOB SWIFT *
1090 ; *
1100 ; TPUG #507 *
1110 ; *
1120 ;*********************************
1130 ; *
1140 ; THIS PROGRAM ALLOWS YOU TO *
1150 ; DRAW ON THE SCREEN USING ALL *
1160 ; COLORS, CURSOR CONTROLS, TEXT *
1170 ; AND GRAPHICS CHARACTERS. WHEN *
1180 ; YOUR SCREEN IS COMPLETE, THE *
1190 ; PROGRAM WILL WRITE A BASIC *
1200 ; PROGRAM THAT WILL RE-DRAW *
1210 ; YOUR SCREEN. THIS PROGRAM IS *
1220 ; RUN IN THE FOLLOWING MANNER. *
1230 ; *
1240 ; SYS 49152, LN *
1250 ; *
1260 ; WHERE *
1270 ; *
1280 ; LN=START BASIC LINE NUMBER *
1290 ; *
1300 ;*********************************
1310 ; *
1320 ; COMMANDS. *
1330 ; *
1340 ; <F1> = CHANGE BORDER COLOR *
1350 ; <F2> = COMPILE BASIC PROGRAM *
1360 ; <F3> = CHANGE BACKGROUND COLOR *
1370 ; <F7> = DISPLAY HELP SCREEN *
1380 ; <F8> = EXIT TO BASIC *
1390 ; *
1400 ;*********************************
1410 ;
1420 ;
1430 ; ***********
1440 ; * EQUATES *
1450 ; ***********
1460 ;
1470 F1 =133
1480 F2 =137
1490 F3 =134
1500 F7 =136
1510 F8 =140
1520 BKGRND =53281
1530 BORDER =53280
1540 GETIN =$FFE4
1550 PLOT =$FFF0
1560 CHROUT =$FFD2
1570 SCREEN =1024
1580 COLOR =55296
1590 CLALL =$FFE7
1600 BASPNT =$19
1610 MEMLOC =$1B
1620 SCN =$1D
1630 COL =$1F
1640 COLORS =$E8DA
1650 ;
1660 ; **************************
1670 ; * READ START LINE NUMBER *
1680 ; **************************
1690 ;
1700 JSR $AEFD ;CHECK FOR COMMA
1710 JSR $AD9E ;EVALUATE EXPRESSION
1720 JSR $B7F7 ;REAL TO INTEGER
1730 LDA $14 ;LOAD <LINE NUMBER
1740 STA LINUM+1
1750 LDA $15 ;LOAD >LINE NUMBER
1760 STA LINUM
1770 ;
1780 ; **************
1790 ; * INITIALIZE *
1800 ; **************
1810 ;
1820 CLI ;RESET INTERRUPTS
1830 JSR CLALL ;RESET INPUT/OUTPUT
1840 JSR HELP ;DISPLAY HELP SCREEN
1850 LDA #147 ;CLEAR SCREEN
1860 ;
1870 ; *****************
1880 ; * CREATE SCREEN *
1890 ; *****************
1900 ;
1910 PRNTC JSR CHROUT ;OUTPUT CHARACTER
1920 GETCHR LDA #$00 ;ENABLE CURSOR
1930 STA $CC
1940 GET1 LDA $C6 ;NUMBER OF CHARACTERS
1950 BEQ GET1 ;NONE - TRY AGAIN
1960 STA $CC ;DISABLE CURSOR
1970 SEI ;TURN OFF INTERRUPTS
1980 LDA $CF ;CURSOR IN BLINK PHASE
1990 BEQ BLINK ;YES - MOVE ON
2000 LDA $CE ;GET HIDDEN CHARACTER
2010 LDX $0287 ;GET HIDDEN COLOR
2020 LDY #$00 ;PUT CURSOR IN...
2030 STY $CF ;...BLINK PHASE
2040 JSR $EA13 ;PRINT TO SCREEN
2050 BLINK JSR $E5B4 ;GET FROM KEYBOARD BUFFER
2060 CMP #F1 ;IS IT <F1>
2070 BNE NOTF1 ;NO - MOVE ON
2080 LDX #$00 ;SELECT BORDER
2090 CHGCLR INC BORDER,X ;CHANGE BORDER/BACKGROUND
2100 LDA #$0F ;CLEAR ...
2110 AND BORDER,X ;...HIGH ...
2120 STA BORDER,X ;...NYBBLE
2130 JMP GETCHR ;(null) BACK FOR MORE
2140 NOTF1 CMP #F3 ;IS IT <F3>
2150 BNE NOTF3 ;NO - MOVE ON
2160 LDX #$01 ;SELECT BACKGROUND
2170 BNE CHGCLR ;(null) CHANGE COLOR
2180 NOTF3 CMP #F8 ;IS IT <F8>
2190 BNE NOTF8 ;NO - MOVE ON
2200 QUIT LDA #$00 ;CLEAR KEYBOARD BUFFER
2210 STA $C6
2220 LDA #$0D ;PRINT CARRIAGE RETURN
2230 JSR CHROUT
2240 RTS ;(null) BACK TO BASIC
2250 NOTF8 CMP #F7 ;IS IT <F7>
2260 BNE NOTF7 ;NO - MOVE ON
2270 JSR HELP ;DISPLAY HELP SCREEN
2280 JMP GETCHR ;BACK FOR MORE
2290 NOTF7 CMP #F2 ;IS IT <F2>
2300 BNE PRNTC ;NO - PRINT AND GET ANOTHER
2310 JMP START ;START WRITING BASIC
2320 ;
2330 ; ******************
2340 ; * FLAGS AND DATA *
2350 ; ******************
2360 ;
2370 RVSFLG .BYTE 0
2380 COLFLG .BYTE 255
2390 LNCNT .BYTE 0
2400 LINUM .BYTE 0,0,1,1,0
2410 POKES .BYTE 151
2420 .ASC "53280,00:"
2430 .BYTE 151
2440 .ASC "53281,00:"
2450 .BYTE 153,34,147,142,34,59
2460 LOCOL .ASC " "
2470 .ASC " 111111"
2480 HICOL .ASC "01234567"
2490 .ASC "89012345"
2500 ;
2510 ; *********************
2520 ; * STORE LINE NUMBER *
2530 ; *********************
2540 ;
2550 LINPRT LDY #$05 ;SET COUNTER
2560 LINCNT DEY ;COUNT
2570 LDA LINUM,Y ;GET INFO
2580 JSR STOINC ;SAVE INFO
2590 TYA ;CHECK COUNTER - ARE WE DONE
2600 BNE LINCNT ;NO - (null) BACK FOR MORE
2610 LDA #$FF
2620 CMP LINUM+1 ;INCREMENT HIGH AND LOW ?
2630 BNE LBACK ;NO - DO LOW ONLY
2640 INC LINUM ;DO HIGH BYTE
2650 LBACK INC LINUM+1 ;DO LOW BYTE
2660 RTS
2670 ;
2680 ; ******************************
2690 ; * STORE AND INCREMENT MEMORY *
2700 ; ******************************
2710 ;
2720 STOINC STY $26 ;SAVE Y-REGISTER
2730 LDY #$00 ;SET INDEX OFFSET
2740 STA (BASPNT),Y ;SAVE BYTE TO MEMORY
2750 JSR MEMPLS ;INCREMENT MEMORY COUNTER
2760 LDY $26 ;GET Y-REGISTER
2770 RTS
2780 ;
2790 ; ******************
2800 ; * VALUE TO ASCII *
2810 ; ******************
2820 ;
2830 DIGITS AND #$0F ;MASK OFF HIGH NYBBLE
2840 TAX ;SAVE VALUE
2850 LDA HICOL,X ;GET HIGH COLOR
2860 TAY ;SAVE IN Y-REGISTER
2870 LDA LOCOL,X ;GET LOW COLOR
2880 RTS
2890 ;
2900 ; ********************
2910 ; * INCREMENT MEMORY *
2920 ; ********************
2930 ;
2940 MEMPLS LDA #$FF
2950 CMP BASPNT ;INCREMENT HIGH AND LOW ?
2960 BNE MBACK ;NO - MOVE ON
2970 INC BASPNT+1 ;INCREMENT HIGH BYTE
2980 MBACK INC BASPNT ;INCREMENT LOW BYTE
2990 RTS
3000 ;
3010 ; ***********************
3020 ; * STORE MEMORY BUFFER *
3030 ; ***********************
3040 ;
3050 MEMSTO STY $26 ;SAVE Y-REGISTER
3060 LDY #$00 ;SET INDEX OFFSET
3070 STA (MEMLOC),Y ;SAVE TO BUFFER
3080 LDY $26 ;GET Y-REGISTER
3090 ;
3100 ; ****************************
3110 ; * INCREMENT BUFFER POINTER *
3120 ; ****************************
3130 ;
3140 MEMADD LDA #$FF
3150 CMP MEMLOC ;INCREMENT HIGH AND LOW ?
3160 BNE MMBACK ;NO - MOVE ON
3170 INC MEMLOC+1 ;INCREMENT HIGH BYTE
3180 MMBACK INC MEMLOC ;INCREMENT LOW BYTE
3190 RTS
3200 ;
3210 ; *************************
3220 ; * TRANSFER MEMORY BLOCK *
3230 ; *************************
3240 ;
3250 TRNSFR LDY #$00 ;SET OFFSET
3260 MOVLP LDA (MEMLOC),Y ;GET BYTE
3270 JSR STOINC ;SAVE BYTE
3280 JSR MEMADD ;INCREMENT POINTER
3290 LDA BASPNT ;CHECK LOW BYTE
3300 CMP SCN ;IS IT THE SAME
3310 BNE MOVLP ;NO - BACK FOR MORE
3320 LDA BASPNT+1 ;CHECK HIGH BYTE
3330 CMP SCN+1 ;IS IT THE SAME
3340 BNE MOVLP ;NO - BACK FOR MORE
3350 RTS ;YES - RETURN
3360 ;
3370 ;
3380 ;
3390 ;*********************************
3400 ; *
3410 ; BUILD BASIC PROGRAM *
3420 ; *
3430 ;*********************************
3440 ;
3450 ;
3460 ;
3470 ; ***********************
3480 ; * INITIALIZE POINTERS *
3490 ; ***********************
3500 ;
3510 START LDA #$01
3520 STA $2B ;START OF BASIC LOW BYTE
3530 LDA #$08
3540 STA $2C ;START OF BASIC HIGH BYTE
3550 STA BASPNT+1 ;BASIC POINTER HIGH BYTE
3560 LDX #$00
3570 STX RVSFLG ;REVERSE FLAG
3580 STX SCN ;SCREEN LOCATION LOW BYTE
3590 STX COL ;COLOR LOCATION LOW BYTE
3600 STX BASPNT ;BASIC POINTER LOW BYTE
3610 JSR LINPRT ;STORE FIRST LINE #
3620 LDA #$FF
3630 STA COLFLG ;SET IMPOSSIBLE COLOR
3640 LDX #26 ;FIRST LINE COUNTER
3650 LDY #$00 ;COUNTER
3660 STY MEMLOC ;BUFFER POINTER LOW
3670 ;
3680 ; ***********************
3690 ; * FIRST LINE OF BASIC *
3700 ; ***********************
3710 ;
3720 LPOKE LDA POKES,Y ;LOAD DATA
3730 JSR STOINC ;SAVE DATA
3740 INY ;INCREMENT OFFSET
3750 DEX ;DECREMENT POINTER
3760 BNE LPOKE ;BACK FOR MORE
3770 LDA $D018 ;UPPER/LOWER CASE FLAG
3780 AND #$02 ;CHECK PROPER BIT
3790 BEQ ENDCSE ;UPPER CASE - MOVE ON
3800 LDA #14 ;ASCII LOWER CASE
3810 STA $081C ;SAVE IN BASIC
3820 ENDCSE LDA BORDER ;GET BORDER COLOR
3830 JSR DIGITS ;CONVERT TO ASCII
3840 STA $080C ;SAVE IN BASIC
3850 STY $080D
3860 LDA BKGRND ;GET BACKGROUND COLOR
3870 JSR DIGITS ;CONVERT TO ASCII
3880 STA $0816 ;SAVE IN BASIC
3890 STY $0817
3900 LDA #$40
3910 STA MEMLOC+1 ;BUFFER POINTER HIGH
3920 LDA #$04
3930 STA SCN+1 ;SCREEN POINTER HIGH
3940 LDA #$D8
3950 STA COL+1 ;COLOR POINTER HIGH
3960 LDX #$00 ;SCREEN LINE COUNTER
3970 ;
3980 ; **********************
3990 ; * COMPILE PRINT INFO *
4000 ; **********************
4010 ;
4020 STLINE LDY #$00 ;SCREEN COLUMN COUNTER
4030 STY LNCNT ;HOW MUCH TO PRINT
4040 RDCHR1 LDA (SCN),Y ;GET SCREEN CHARACTER
4050 INY ;INCREMENT COLUMN COUNTER
4060 CMP #$20 ;IS CHARACTER A SPACE
4070 BEQ CHRBAD ;YES - MOVE ON
4080 STY LNCNT ;SET LINE POSITION
4090 CHRBAD CPY #$28 ;END OF LINE
4100 BNE RDCHR1 ;NO - (null) BACK FOR MORE
4110 LDA LNCNT ;ANY PRINT ON LINE
4120 BNE SOME ;YES - MOVE ON
4130 LDA #$11 ;CURSOR DOWN
4140 JSR MEMSTO ;SAVE TO BUFFER
4150 (null)BACK CLC
4160 LDA #$28 ;ADD 40 TO SCREEN LOCATION
4170 ADC SCN
4180 STA SCN
4190 STA COL ;AND COLOR LOCATION
4200 BCC CKMORE ;CHECK SOME MORE
4210 INC SCN+1 ;INCREMENT HIGH BYTES
4220 INC COL+1
4230 CKMORE INX ;LINE COUNTER
4240 CPX #$19 ;END OF SCREEN
4250 BNE STLINE ;NO - BACK FOR MORE
4260 LDA #$00 ;SET END OF DATA
4270 JSR MEMSTO
4280 LDA #$00 ;SET END OF DATA
4290 JSR MEMSTO
4300 JSR MEMLOW
4310 JMP COMPIL ;YES - WRITE TO BASIC
4320 ;
4330 ; ************************
4340 ; * PRINT INFO TO BUFFER *
4350 ; ************************
4360 ;
4370 SOME LDY #$00 ;OFFSET COUNTER
4380 SOME1 LDA (SCN),Y ;SCREEN CHARACTER
4390 CMP #$20 ;IS IT A SPACE
4400 BNE NOTSPC ;NO - MOVE ON
4410 LDA #$1D ;CURSOR RIGHT
4420 MEMPRT JSR MEMSTO ;SAVE TO BUFFER
4430 JMP SOMNXT ;(null) CHECK FOR MORE
4440 NOTSPC AND #$80 ;HIGHER THAN 127
4450 BEQ LC ;NO - NOT A REVERSE
4460 CMP RVSFLG ;REVERSE FLAG SET
4470 BEQ RVSOK ;YES - MOVE ON
4480 STA RVSFLG ;SET REVERSE FLAG
4490 LDA #$12 ;ASCII REVERSE ON
4500 JSR MEMSTO ;SAVE TO BUFFER
4510 JMP RVSOK ;MOVE ALONG
4520 LC CMP RVSFLG ;REVERSE FLAG CLEAR
4530 BEQ RVSOK ;YES - MOVE ON
4540 STA RVSFLG ;CLEAR REVERSE FLAG
4550 LDA #$92 ;ASCII REVERSE OFF
4560 JSR MEMSTO ;SAVE TO BUFFER
4570 RVSOK LDA (COL),Y ;CHECK COLOR
4580 AND #$0F ;MASK OFF HIGH NYBBLE
4590 CMP COLFLG ;IS IT CURRENT COLOR
4600 BEQ COLOK ;YES - MOVE ON
4610 STA COLFLG ;SET CURRENT COLOR
4620 STX $26 ;SAVE X-REGISTER
4630 TAX ;SET COLOR OFFSET
4640 LDA COLORS,X ;ASCII COLOR
4650 LDX $26 ;GET X-REGISTER
4660 JSR MEMSTO ;SAVE TO BUFFER
4670 COLOK LDA (SCN),Y ;GET SCREEN CHARACTER
4680 AND #$7F ;MASK OFF HIGH BIT
4690 STA $26 ;SAVE NORMAL CHARACTER
4700 AND #$1F ;MASK OFF 3 HIGH BITS
4710 CMP $26 ;LESS THAN 32
4720 BNE HIGH ;NO - MOVE ON
4730 HIGHER LDA $26 ;GET CHARACTER BACK
4740 CLC
4750 ADC #$40 ;CONVERT TO ASCII
4760 JMP MEMPRT ;SAVE AND GET ANOTHER
4770 HIGH LDA $26 ;GET VALUE BACK
4780 AND #$60 ;CHECK BITS 5 AND 6
4790 CMP #$60 ;IS IT MORE THAN 95
4800 BEQ HIGHER ;YES - (null) BACK
4810 LDA $26 ;GET CHARACTER BACK
4820 AND #$40 ;CHECK BIT 6
4830 CMP #$40 ;IS IT MORE THAN 63
4840 BNE LOW ;NO - MOVE ON
4850 LDA $26 ;GET VALUE BACK
4860 CLC
4870 ADC #$20 ;ADD 32
4880 STA $26 ;SAVE FOR NOW
4890 LOW LDA $26 ;GET VALUE BACK
4900 JSR MEMSTO ;SAVE TO BUFFER
4910 SOMNXT INY ;INCREMENT COLUMN COUNTER
4920 CPY LNCNT ;ARE WE DONE
4930 BEQ NXTLIN ;YES - DO NEXT LINE
4940 JMP SOME1 ;BACK FOR MORE
4950 NXTLIN LDA #$28 ;40TH CHARACTER
4960 CMP LNCNT ;IS IT END OF LINE
4970 BEQ NXT ;YES - (null) FOR MORE
4980 LDA #$00
4990 STA RVSFLG ;CLEAR REVERSE FLAG
5000 JSR MEMSTO ;SAVE END OF LINE
5010 NXT JMP (null)BACK ;BACK FOR MORE
5020 ;
5030 ; ************************
5040 ; * LOWER BUFFER POINTER *
5050 ; ************************
5060 ;
5070 MEMLOW LDA MEMLOC ;SET TO CHECK
5080 BNE LOWER ;DO LOW BYTE ONLY
5090 DEC MEMLOC+1 ;DECREMENT HIGH BYTE
5100 LOWER DEC MEMLOC ;DECREMENT LOW BYTE
5110 RTS
5120 ;
5130 ; *****************
5140 ; * SHORTEN LINES *
5150 ; *****************
5160 ;
5170 COMPIL JSR MEMLOW ;LOWER BUFFER POINTER
5180 LDY #$00 ;SET OFFSET COUNTER
5190 LDA (MEMLOC),Y ;GET A CHARACTER
5200 BEQ COMPIL ;ZERO - BACK FOR ANOTHER
5210 CMP #$11 ;CHECK FOR CURSOR DOWN
5220 BEQ COMPIL ;YES - BACK FOR MORE
5230 JSR MEMADD ;INCREMENT BUFFER POINTER
5240 LDA #$00
5250 JSR MEMSTO ;MARK END OF LINE
5260 LDA #$00
5270 JSR MEMSTO ;MARK END OF DATA
5280 LDA #$00
5290 STA MEMLOC ;RESET BUFFER POINTER
5300 LDA #$40
5310 STA MEMLOC+1 ;RESET BUFFER POINTER
5320 ;
5330 ; ***********************
5340 ; * STORE BASIC PROGRAM *
5350 ; ***********************
5360 ;
5370 SAVLIN JSR LINPRT ;NEW LINE NUMBER
5380 LDX #$48 ;MAXIMUM LINE LENGTH
5390 LDY #$00 ;OFFSET COUNTER
5400 LDA #$99 ;LOAD CODE FOR PRINT
5410 JSR STOINC
5420 LDA #$22 ;OPEN QUOTES
5430 JSR STOINC
5440 STINFO LDA (MEMLOC),Y ;GET DATA
5450 PHA ;SAVE FOR NOW
5460 JSR MEMADD ;INCREMENT BUFFER POINTER
5470 PLA ;GET INFO BACK
5480 BEQ ENDLIN ;MOVE ON IF END OF LINE
5490 JSR STOINC ;SAVE DATA
5500 DEX ;IS LINE TOO LONG
5510 BNE STINFO ;NO - BACK FOR MORE
5520 LDA (MEMLOC),Y ;GET NEXT BYTE
5530 BEQ STINFO ;BACK FOR NEXT LINE
5540 LDA #$22 ;CLOSE QUOTES
5550 JSR STOINC
5560 LDA #$3B ;SEMI-COLON
5570 JSR STOINC
5580 JMP SAVLIN ;BACK FOR NEXT LINE
5590 ENDLIN LDA #$22 ;CLOSE QUOTES
5600 JSR STOINC
5610 LDA (MEMLOC),Y ;GET NEXT BYTE
5620 BNE SAVLIN ;NOT ZERO - BACK FOR MORE
5630 JSR STOINC ;SAVE THREE ZERO'S...
5640 LDA #$00 ;...AT END OF BASIC
5650 JSR STOINC
5660 LDA #$00
5670 JSR STOINC
5680 ;
5690 ; *****************************
5700 ; * SET END OF BASIC POINTERS *
5710 ; *****************************
5720 ;
5730 LDA BASPNT ;END OF BASIC LOW BYTE
5740 STA $2D
5750 LDA BASPNT+1 ;END OF BASIC HIGH BYTE
5760 STA $2E
5770 ;
5780 ; ********************
5790 ; * CLEAN UP AND END *
5800 ; ********************
5810 ;
5820 LDA #$93 ;CLEAR SCREEN
5830 JSR CHROUT
5840 JSR $A533 ;LINK BASIC LINES
5850 JSR $A659 ;SET CHRGET POINTER AND CLR
5860 JMP $A474 ;BACK TO BASIC
5870 ;
5880 ;
5890 ;
5900 ;*********************************
5910 ; *
5920 ; *
5930 ; HELP SCREEN ROUTINE *
5940 ; *
5950 ; *
5960 ;*********************************
5970 ;
5980 ;
5990 ;
6000 ; ********************
6010 ; * HELP SCREEN DATA *
6020 ; ********************
6030 ;
6040 HLPSCN .BYTE 147
6050 .ASC "SCREEN 40.3"
6060 .BYTE 13
6070 .ASC "BOB SWIFT (TPUG #507)"
6080 .BYTE 13,13
6090 .ASC "COMMANDS IN SCREEN MODE:"
6100 .BYTE 13,13
6110 .ASC "<F1> CHANGE BORDER COLOR"
6120 .BYTE 13
6130 .ASC "<F2> COMPILE BASIC PROGRAM"
6140 .BYTE 13
6150 .ASC "<F3> CHANGE BACKGROUND COLOR"
6160 .BYTE 13
6170 .ASC "<F7> DISPLAY HELP SCREEN"
6180 .BYTE 13
6190 .ASC "<F8> EXIT TO BASIC"
6200 .BYTE 13,13
6210 .ASC "PRESS <F7> TO RETURN TO "
6220 .ASC "SCREEN MODE."
6230 ;
6240 ; ****************************
6250 ; * SAVE CURRENT SCREEN INFO *
6260 ; ****************************
6270 ;
6280 HELP SEC
6290 JSR PLOT ;GET CURSOR POSITION
6300 TXA
6310 PHA ;SAVE ROW
6320 TYA
6330 PHA ;SAVE COLUMN
6340 LDA $C7 ;GET REVERSE FLAG
6350 STA RVSFLG ;SAVE FOR NOW
6360 LDA $0286 ;GET CURRENT COLOR
6370 STA COLFLG ;SAVE FOR NOW
6380 LDA BKGRND ;GET SCREEN COLOR
6390 STA COL ;SAVE FOR NOW
6400 LDA BORDER ;GET BORDER COLOR
6410 STA COL+1 ;SAVE FOR NOW
6420 LDA #$40
6430 STA BASPNT+1 ;BUFFER POINTER HIGH
6440 LDA #>SCREEN
6450 STA MEMLOC+1 ;SCREEN POINTER HIGH
6460 LDA #$00
6470 STA BASPNT ;BUFFER POINTER LOW
6480 STA MEMLOC ;SCREEN POINTER LOW
6490 LDA #<($4000+1000)
6500 STA SCN ;END OF BUFFER LOW
6510 LDA #>($4000+1000)
6520 STA SCN+1 ;END OF BUFFER HIGH
6530 JSR TRNSFR ;MOVE SCREEN INFO
6540 LDA #<COLOR
6550 STA MEMLOC ;COLOR MEMORY LOW
6560 LDA #>COLOR
6570 STA MEMLOC+1 ;COLOR MEMORY HIGH
6580 LDA #<($4000+2000)
6590 STA SCN ;END OF BUFFER LOW
6600 LDA #>($4000+2000)
6610 STA SCN+1 ;END OF BUFFER HIGH
6620 JSR TRNSFR ;MOVE COLOR INFO
6630 ;
6640 ; **********************
6650 ; * SET UP HELP SCREEN *
6660 ; **********************
6670 ;
6680 LDA #9 ;BROWN
6690 STA BORDER ;SET BORDER COLOR
6700 LDA #3 ;CYAN
6710 STA BKGRND ;SET BACKGROUND COLOR
6720 LDA #$00 ;BLACK
6730 STA $0286 ;CURRENT COLOR
6740 TAX ;INITIALIZE COUNTER
6750 HSPRT LDA HLPSCN,X ;GET CHARACTER
6760 JSR CHROUT ;PRINT CHARACTER
6770 INX ;INCREMENT COUNTER
6780 CPX #HELP-HLPSCN ;ARE WE DONE
6790 BNE HSPRT ;NO - BACK FOR MORE
6800 ;
6810 ; *********************
6820 ; * WAIT FOR <F7> KEY *
6830 ; *********************
6840 ;
6850 LDA #$00
6860 STA 198 ;EMPTY KEYBOARD BUFFER
6870 HPGET JSR GETIN ;CHECK KEYBOARD
6880 CMP #F7 ;IS <F7> PRESSED
6890 BNE HPGET ;NO - TRY AGAIN
6900 ;
6910 ; *************************
6920 ; * RETURN TO SCREEN MODE *
6930 ; *************************
6940 ;
6950 LDA COL ;RESTORE PARAMETERS
6960 STA BKGRND ; -BACKGROUND
6970 LDA COL+1
6980 STA BORDER ; -BORDER
6990 LDA COLFLG
7000 STA $0286 ; -CURRENT COLOR
7010 LDA RVSFLG
7020 STA $C7 ; -REVERSE FLAG
7030 LDA #$40
7040 STA MEMLOC+1 ;BUFFER POINTER HIGH
7050 LDA #>SCREEN
7060 STA BASPNT+1 ;SCREEN POINTER HIGH
7070 LDA #$00
7080 STA MEMLOC ;BUFFER POINTER LOW
7090 STA BASPNT ;SCREEN POINTER LOW
7100 LDA #<(SCREEN+1000)
7110 STA SCN ;END OF SCREEN LOW
7120 LDA #>(SCREEN+1000)
7130 STA SCN+1 ;END OF SCREEN HIGH
7140 JSR TRNSFR ;RESTORE SCREEN INFO
7150 LDA #<COLOR
7160 STA BASPNT ;COLOR POINTER LOW
7170 LDA #>COLOR
7180 STA BASPNT+1 ;COLOR POINTER HIGH
7190 LDA #<(COLOR+1000)
7200 STA SCN ;END OF COLOR LOW
7210 LDA #>(COLOR+1000)
7220 STA SCN+1 ;END OF COLOR HIGH
7230 JSR TRNSFR ;RESTORE COLOR INFO
7240 PLA
7250 TAY ;CURSOR Y-POSITION
7260 PLA
7270 TAX ;CURSOR X-POSITION
7280 CLC
7290 JMP PLOT ;SET CURSOR AND RETURN
7300 .END
7310 CLOSE2:CLOSE3:CLOSE4:CLOSE15:OPEN15,8,15:CLOSE15